package com.dmzc.stage2.chapter14;

/***
 * 懒汉式
 * 能够实现懒加载，但是不能保证线程安全？？？
 */
public final class Singleton1 {
    private byte[] data=new byte[1024];
    private static Singleton1 instance=null;
    private Singleton1(){}
    public static Singleton1 getInstance(){
        if (null==instance)
            instance=new Singleton1();
        return instance;
    }
}
